#include "dominion.h"
#include "dominion_helpers.h"
#include "rngs.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <math.h>


int main ()
{

	struct gameState g;
	int players = 2;
	int k[10] = {adventurer, council_room, sea_hag, gardens, mine, remodel, smithy, village, baron, great_hall};
	int seed = 100;
	int res, res2, player, coins, estates;
	int bonus = 0;
	//initialize game
	res = initializeGame(players, k, seed, &g);
	player = whoseTurn(&g);
	coins = g.coins;
	estates = g.supplyCount[estate];
	
	printf("\n~~~~~~~~~~TESTING BARON~~~~~~~~~~\n");
	printf("Current hand size = %d\n", numHandCards(&g));
	printf("Current gold = %d\n", coins);
	printf("Current buys = %d\n", g.numBuys);
	res2 = res;
	
	res = cardEffect(baron, 0, 0, 0, &g, 5, &bonus);
	//+1 buy
	printf("+1 Buy expected, regardless of choice\n");
	printf("Number of buys expected = 2, actual = %d\n", g.numBuys);
	assert(g.numBuys == 2);
	printf("OPTION 0!\n");
	printf("Number of cards expected = 5, actual = %d\n", numHandCards(&g));
	assert(numHandCards(&g) == 5);
	printf("Coins expected = %d, actual = %d\n", coins, g.coins);
	assert(g.coins == coins);
	int newEstate;
	newEstate = estates - 1;
	printf("Number of estates expected: %d, actual: %d\n", newEstate, g.supplyCount[estate]);
	assert(g.supplyCount[estate] == newEstate);

	return 0;

}